[ykj_id].vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <div class="cjfx_cjd">
  3. <NavHeader />
  4. <bread-crumb />
  5. <div class="w-1200px m-auto flex flex-row justify-between">
  6. <div class="w-188">
  7. <leftSider :activeIndex="activeIndex" :ykjId="ykjId" @parentClick="parentClick"/>
  8. </div>
  9. <div class="w-942 p-4 blueBg">
  10. <div class="flex items-center">
  11. <optionSelect @optionClick="optionClick" />
  12. </div>
  13. <div class="mt-4 exportBtn">
  14. <el-button color="#003eee" type="primary" size="large" @click="exportBtn">导出</el-button>
  15. </div>
  16. <div class="h-218px mt-5px bg-gray-500 py-4 pl-150px pr-100px perfectShow">
  17. <div class="h-full flex justify-between" v-if="rangeData.length==0">
  18. <div class="h-full bg-opacity-20 rounded singlepart" v-for="(item, index) in rangeData" :key="index">
  19. <div class="h-1/3 text-center py-4 RankLabel">
  20. <img :src="'/images/one'+(index+1)+'.png'" alt="">
  21. </div>
  22. <div class="text-sm p-5px RankBaseInfo">
  23. <p class="h-1/4">考号:{{ item.kh }}</p>
  24. <p class="h-1/4">成绩:{{item.cj}}分</p>
  25. <p class="h-1/4">名次:{{ item.mc }}</p>
  26. <p class="h-1/4">学校:{{ item.xx }}</p>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="text-center " style="line-height:218px;" v-else>
  31. 暂无排名~
  32. </div>
  33. </div>
  34. <div class="h-auto mt-9px listMain" >
  35. <div class="h-74px flex flex-wrap flex-grow justify-between rounded px-4 listMain_title" >
  36. <div class="singleT" :class="{ 'h-full singleD': !!([1, 2, 3].indexOf(index) + 1) }">{{ listTitleShow.kh }}</div>
  37. <div class="singleT" :class="{ 'h-full singleD': !!([1, 2, 3].indexOf(index) + 1) }">{{ listTitleShow.xm }}</div>
  38. <div class="singleT" :class="{ 'h-full singleD': !!([1, 2, 3].indexOf(index) + 1) }">{{ listTitleShow.bj }}</div>
  39. <div class="h-full singleD" v-for="(secItem, secIndex) in listTitleShow.subInfo" :key="secIndex">
  40. <div class="h-1/2 text-center">{{ secItem.subTitle }}</div>
  41. <div class="h-1/2 flex flex-wrap flex-grow justify-between">
  42. <div class="secFullWidth">{{ secItem.fs }}</div>
  43. <div class="secFullWidth">{{ secItem.bp }}</div>
  44. <div class="secFullWidth">{{ secItem.np }}</div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="h-60px flex flex-wrap flex-grow justify-between px-4" :class="{ 'whiteBG': (index + 1) % 2 != 1 }"
  49. v-for="(item, index) in listShow" :key="index">
  50. <div class="singleTSec" :class="{ 'h-full singleDSec': !!([1, 2, 3].indexOf(index) + 1) }">{{ item.kh }}</div>
  51. <div class="singleTSec" :class="{ 'h-full singleDSec': !!([1, 2, 3].indexOf(index) + 1) }">{{ item.xm }}</div>
  52. <div class="singleTSec" :class="{ 'h-full singleDSec': !!([1, 2, 3].indexOf(index) + 1) }">{{ item.bj }}</div>
  53. <div class="h-full singleDSec" v-for="(secItem, secIndex) in item.subInfo" :key="secIndex">
  54. <div class="h-full flex flex-wrap flex-grow justify-between">
  55. <div class="secFullWidth">{{ secItem.fs }}</div>
  56. <div class="secFullWidth">{{ secItem.bp }}</div>
  57. <div class="secFullWidth">{{ secItem.np }}</div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <!-- 优化的图标结构 -->
  63. <el-table :data="tableMicData" border style="width: 100%">
  64. <el-table-column prop="name" align="center" label="年级"> </el-table-column>
  65. <!-- 循环1级表头 -->
  66. <template v-for="(item, index) in tableMicTitle" :key="index">
  67. <el-table-column align="center" :label="item" >
  68. <!-- 循环2级表头 -->
  69. <template v-for="items in tableMicLabel" :key="items.key">
  70. <el-table-column :label="items.label" width="100" align="center">
  71. <template v-for="(i,index) in items.type" :key="index" slot-scope="scope">
  72. <div>
  73. {{ scope.row.type[index][items.key] }}
  74. </div>
  75. </template>
  76. </el-table-column>
  77. </template>
  78. </el-table-column>
  79. </template>
  80. </el-table>
  81. </div>
  82. </div>
  83. <commonFooter />
  84. </div>
  85. </template>
  86. <route lang="json">
  87. {
  88. "meta": {
  89. "title": "考试分析",
  90. "breadcrumb": true
  91. }
  92. }
  93. </route>
  94. <script lang="ts" setup>
  95. import {cjfx_cjd_list } from '../apiItem';
  96. import {user} from "~/store";
  97. const route = useRoute();
  98. // 侧边栏点击
  99. const activeIndex = ref('1-1');
  100. let ykjId = ref();
  101. const parentClick = (val: string) => {
  102. activeIndex.value = val;
  103. ykjId.value = route.params.ykj_id;
  104. }
  105. let rangeData =ref([])
  106. let listTitleShow = ref({
  107. "kh": "考号",
  108. "xm": "姓名",
  109. "bj": "班级",
  110. "subInfo": [
  111. {
  112. "subTitle": "语文",
  113. "fs": "分数",
  114. "bp": "班排",
  115. "np": "年排",
  116. }
  117. ]
  118. });
  119. let listShow = ref([
  120. {
  121. "kh": "2345443211",
  122. "xm": "迪丽热巴",
  123. "bj": "初一(2)班",
  124. "subInfo": [
  125. {
  126. "subTitle": "语文",
  127. "fs": "87.45",
  128. "bp": "1",
  129. "np": "1",
  130. }
  131. ]
  132. },
  133. ]);
  134. ykjId.value = route.params.ykj_id;
  135. const tableMicTitle = ref();
  136. const tableMicLabel=ref([
  137. {
  138. label: "R%",
  139. key: "mgan",
  140. },
  141. {
  142. label: "S%",
  143. key: "naiyao",
  144. },
  145. {
  146. label: "I%",
  147. key: "zjie",
  148. },
  149. ]);
  150. const tableMicData = ref(
  151. [{
  152. name: "asd",
  153. type: [
  154. { tab: "肺炎克雷伯", mgan: "1", naiyao: "2", zjie: "3" },
  155. { tab: "铜绿假", mgan: "4", naiyao: "5", zjie: "6" },
  156. { tab: "鲍式不动杆菌", mgan: "9", naiyao: "8", zjie: "7" },
  157. ],
  158. },
  159. {
  160. name: "asd2",
  161. type: [
  162. { tab: "肺炎克雷伯", mgan: "11", naiyao: "12", zjie: "13" },
  163. { tab: "铜绿假", mgan: "21", naiyao: "22", zjie: "23" },
  164. { tab: "鲍式不动杆菌", mgan: "1", naiyao: "2", zjie: "33" },
  165. ],
  166. }]
  167. );
  168. onMounted(() => {
  169. initData();
  170. //循环+去重
  171. aa();
  172. })
  173. const aa = () => {
  174. let tableMicTitle_temp: Iterable<any>|null|undefined = [];
  175. tableMicData.value.forEach(o=>{
  176. o.type.forEach(item => {
  177. tableMicTitle_temp.push(item.tab)
  178. })
  179. })
  180. tableMicTitle.value = [...new Set(tableMicTitle_temp)]
  181. }
  182. const school_id = ref("");
  183. const grade_id = ref("");
  184. const xueke_id = ref("");
  185. // 初始化数据
  186. const initData =() => {
  187. let transObj = {
  188. school_id:school_id.value,
  189. cm_id: grade_id.value,
  190. xueke_id: xueke_id.value,
  191. jh_id:route.params.ykj_id,//考试计划id
  192. }
  193. cjfx_cjd_list(transObj)
  194. .then(res => {
  195. if (res.code == "1") {
  196. listTitleShow.value = res.data.data.listTitleShow;
  197. listShow.value = res.data.data.listShow;
  198. rangeData.value = res.data.data.rangeData;
  199. }
  200. })
  201. .catch(error=>{console.log(error)})
  202. }
  203. //option筛选
  204. const optionClick = (val: any, marke: any) => {
  205. if (marke == "scholl") {
  206. school_id.value = val;
  207. } else if (marke == "grade") {
  208. grade_id.value = val;
  209. } else {
  210. xueke_id.value = val;
  211. }
  212. initData();
  213. }
  214. //导出
  215. const exportBtn = () => {
  216. let prefixedUrl = window.GLOBAL_CONFIG.web_pc;
  217. let fullUrl = prefixedUrl + '/openapi/echart/transcript.php?api=xls&token=' + user.value.token;
  218. window.open(fullUrl,'_blank')
  219. }
  220. </script>
  221. <style lang="scss" scoped>
  222. ::v-deep .el-sub-menu__title {
  223. background: #003eee;
  224. color: #fff;
  225. }
  226. .blueBg {
  227. background: #F1F7FF;
  228. }
  229. .whiteBG {
  230. background: #fff;
  231. }
  232. .singlepart {
  233. background-color: rgba($color: #ffffff, $alpha: 0.2);
  234. color: #fff;
  235. }
  236. .listMain {
  237. max-height: 600px;
  238. overflow: auto;
  239. }
  240. .listMain_title {
  241. font-size: 16px;
  242. color: #fff;
  243. background: #003eee;
  244. overflow-y: auto;
  245. }
  246. .singleT {
  247. // flex: 1;
  248. // width: fit-content;
  249. line-height: 74px;
  250. width:100px;
  251. text-align: center;
  252. }
  253. .singleD {
  254. // flex: 1;
  255. width:100px;
  256. }
  257. .singleTSec {
  258. // width: fit-content;
  259. // flex: 1;
  260. width:100px;
  261. line-height: 60px;
  262. text-align: center;
  263. }
  264. .singleDSec {
  265. // flex: 1;
  266. line-height: 60px;
  267. width:200px;
  268. }
  269. .secFullWidth {
  270. width: fit-content;
  271. flex: 1;
  272. text-align: center;
  273. }
  274. .perfectShow{
  275. background: url("/images/big_bg.png") no-repeat left top;
  276. background-size:cover;
  277. }
  278. .RankLabel{
  279. text-align: center;
  280. img{
  281. display: inline-block;
  282. width: 30%;
  283. }
  284. }
  285. </style>